

<!doctype html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>skidl.skidl module &#8212; SKiDL 1.2.2 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/bizstyle.css?v=a66e137f" />
    
    <script src="../_static/documentation_options.js?v=fd7cadf9"></script>
    <script src="../_static/doctools.js?v=9a2dae69"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/bizstyle.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <!--[if lt IE 9]>
    <script src="_static/css3-mediaqueries.js"></script>
    <![endif]-->
  </head><body>
    <h1 id="site-title"><a href="../../../"><img src="../../../images/slim_banner.png" width="100%"></a></h1>
    
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 1.2.2 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.skidl module</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="module-skidl.skidl">
<span id="skidl-skidl-module"></span><h1>skidl.skidl module<a class="headerlink" href="#module-skidl.skidl" title="Link to this heading">¶</a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.ERC">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">ERC</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.ERC" title="Link to this definition">¶</a></dt>
<dd><p>Run class-wide and local ERC functions on this circuit.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.backup_parts">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">backup_parts</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.backup_parts" title="Link to this definition">¶</a></dt>
<dd><p>Saves parts in circuit as a SKiDL library in a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None. If None, a standard library
file will be used.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Nothing.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.empty_footprint_handler">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">empty_footprint_handler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">part</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.empty_footprint_handler" title="Link to this definition">¶</a></dt>
<dd><p>Handle the situation of a Part with no footprint when generating netlist/PCB.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>part</strong> (<a class="reference internal" href="skidl.part.html#skidl.part.Part" title="skidl.part.Part"><em>Part</em></a>) – The part with no footprint.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>By default, this function logs an error message if the footprint is missing.
Override this function if you want to try and set some default footprint
for particular types of parts (such as using an 0805 footprint for a resistor).</p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.erc_assert">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">erc_assert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fail_msg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'FAILED'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">severity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">ERROR</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.erc_assert" title="Link to this definition">¶</a></dt>
<dd><p>Add an ERC assertion to a class or class instance.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_graph">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_graph</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'neato'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rankdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'LR'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">part_shape</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'rectangle'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">net_shape</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'point'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">splines</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_values</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_anon</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">split_nets</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">['GND']</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">split_parts_ref</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">[]</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_graph" title="Link to this definition">¶</a></dt>
<dd><p>Returns a graphviz graph as graphviz object and can also write it to a file/stream.
When used in ipython the graphviz object will drawn as an SVG in the output.</p>
<p>See <a class="reference external" href="https://graphviz.readthedocs.io/en/stable/">https://graphviz.readthedocs.io/en/stable/</a> and <a class="reference external" href="http://graphviz.org/doc/info/attrs.html">http://graphviz.org/doc/info/attrs.html</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> – A string containing a file name, or None.</p></li>
<li><p><strong>engine</strong> – See graphviz documentation</p></li>
<li><p><strong>rankdir</strong> – See graphviz documentation</p></li>
<li><p><strong>part_shape</strong> – Shape of the part nodes</p></li>
<li><p><strong>net_shape</strong> – Shape of the net nodes</p></li>
<li><p><strong>splines</strong> – Style for the edges, try ‘ortho’ for a schematic like feel</p></li>
<li><p><strong>show_values</strong> – Show values as external labels on part nodes</p></li>
<li><p><strong>show_anon</strong> – Show anonymous net names</p></li>
<li><p><strong>split_nets</strong> – splits up the plot for the given list of net names</p></li>
<li><p><strong>split_parts_ref</strong> – splits up the plot for all pins for the given list of part refs</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>graphviz.Digraph</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_netlist">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_netlist</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_netlist" title="Link to this definition">¶</a></dt>
<dd><p>Return a netlist and also write it to a file/stream.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None.</p></li>
<li><p><strong>tool</strong> – The EDA tool the netlist will be generated for.</p></li>
<li><p><strong>do_backup</strong> – If true, create a library with all the parts in the circuit.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A netlist.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_pcb">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_pcb</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_pcb" title="Link to this definition">¶</a></dt>
<dd><p>Create a PCB file from the circuit.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None.</p></li>
<li><p><strong>tool</strong> – The EDA tool the netlist will be generated for.</p></li>
<li><p><strong>do_backup</strong> – If true, create a library with all the parts in the circuit.</p></li>
<li><p><strong>fp_libs</strong> – List of directories containing footprint libraries.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>None.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_schematic">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_schematic</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_schematic" title="Link to this definition">¶</a></dt>
<dd><p>Create a schematic from a Circuit.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_svg">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_svg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tool</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layout_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_svg" title="Link to this definition">¶</a></dt>
<dd><p>Create an SVG file displaying the circuit schematic and
return the dictionary that can be displayed by netlistsvg.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> (<em>_type_</em><em>, </em><em>optional</em>) – Filename to store SVG. Defaults to None.</p></li>
<li><p><strong>tool</strong> (<em>_type_</em><em>, </em><em>optional</em>) – Backend tool. Defaults to None.</p></li>
<li><p><strong>layout_options</strong> (<em>_type_</em><em>, </em><em>optional</em>) – Options to control netlistsvg/ELK layout algorithm. Defaults to None.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>JSON dictionary for input to netlistsvg.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.11/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.generate_xml">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">generate_xml</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tool</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.generate_xml" title="Link to this definition">¶</a></dt>
<dd><p>Return netlist as an XML string and also write it to a file/stream.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None.</p></li>
<li><p><strong>tool</strong> – Backend tool such as KICAD.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A string containing the netlist.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.get_default_tool">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">get_default_tool</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/skidl.html#get_default_tool"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.skidl.get_default_tool" title="Link to this definition">¶</a></dt>
<dd><p>Get the ECAD tool that will be used by default.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.reset">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">reset</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.skidl.reset" title="Link to this definition">¶</a></dt>
<dd><p>Clear any circuitry and cached part libraries and start over.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.skidl.set_default_tool">
<span class="sig-prename descclassname"><span class="pre">skidl.skidl.</span></span><span class="sig-name descname"><span class="pre">set_default_tool</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tool</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/skidl.html#set_default_tool"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.skidl.set_default_tool" title="Link to this definition">¶</a></dt>
<dd><p>Set the ECAD tool that will be used by default.</p>
</dd></dl>

</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3><a href="../index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">skidl.skidl module</a><ul>
<li><a class="reference internal" href="#skidl.skidl.ERC"><code class="docutils literal notranslate"><span class="pre">ERC()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.backup_parts"><code class="docutils literal notranslate"><span class="pre">backup_parts()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.empty_footprint_handler"><code class="docutils literal notranslate"><span class="pre">empty_footprint_handler()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.erc_assert"><code class="docutils literal notranslate"><span class="pre">erc_assert()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_graph"><code class="docutils literal notranslate"><span class="pre">generate_graph()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_netlist"><code class="docutils literal notranslate"><span class="pre">generate_netlist()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_pcb"><code class="docutils literal notranslate"><span class="pre">generate_pcb()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_schematic"><code class="docutils literal notranslate"><span class="pre">generate_schematic()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_svg"><code class="docutils literal notranslate"><span class="pre">generate_svg()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.generate_xml"><code class="docutils literal notranslate"><span class="pre">generate_xml()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.get_default_tool"><code class="docutils literal notranslate"><span class="pre">get_default_tool()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.reset"><code class="docutils literal notranslate"><span class="pre">reset()</span></code></a></li>
<li><a class="reference internal" href="#skidl.skidl.set_default_tool"><code class="docutils literal notranslate"><span class="pre">set_default_tool()</span></code></a></li>
</ul>
</li>
</ul>

  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/rst_output/skidl.skidl.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 1.2.2 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.skidl module</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
    &#169; Copyright 2016-2024, Dave Vandenbout.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
    </div>
  </body>
</html>